package com.xyz.common.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class Log4jListener implements ServletContextListener {
	public static final String log4j_dir_key = "log4jdir";

	public void contextDestroyed(ServletContextEvent servletContextEvent) {
		System.getProperties().remove(log4j_dir_key);
	}

	public void contextInitialized(ServletContextEvent servletContextEvent) {
		String log4jdir = servletContextEvent.getServletContext().getRealPath("/");
		// System.out.println("log4jdir:"+log4jdir);
		System.setProperty(log4j_dir_key, log4jdir);
	}

}

